import java.util.SortedSet;
import java.util.TreeSet;


public class Personenliste {
	
	public static void main(String args[]){
		SortedSet<Person> PersonSet = new TreeSet<Person>(new PersonenVergleicher());
		PersonSet.add(new Student("Peter"));
		PersonSet.add(new Dozent("Hans"));
		PersonSet.add(new Student("Karl"));
		PersonSet.add(new Dozent("Max"));
		PersonSet.add(new Student("Heinz"));
		PersonSet.add(new Dozent("Gustav"));
		
		for(Person Person : PersonSet){
			System.out.println(Person);
		}
	}

}
